package com.kfzx.www.emptyviewdemo;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class MainActivity extends AppCompatActivity implements View.OnClickListener {

    private Button adapterDataObserverButton, viewTypeButton;
    private Button mHeaderButton, mFooterButton;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        initViews();
    }

    private void initViews() {
        adapterDataObserverButton = (Button) findViewById(R.id.adapter_data_observer_button);
        adapterDataObserverButton.setOnClickListener(this);

        viewTypeButton = (Button) findViewById(R.id.view_type_button);
        viewTypeButton.setOnClickListener(this);

        mHeaderButton = (Button) findViewById(R.id.header_button);
        mHeaderButton.setOnClickListener(this);

        mFooterButton = (Button) findViewById(R.id.footer_button);
        mFooterButton.setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.adapter_data_observer_button:
                startActivity(new Intent(MainActivity.this, AdapterDataObserverActivity.class));
                break;
            case R.id.view_type_button:
                startActivity(new Intent(MainActivity.this, ViewTypeActivity.class));
                break;
            case R.id.header_button:
                break;
            case R.id.footer_button:
                break;
            default:
                break;
        }
    }
}
